<?php
namespace App\Services\Chanjet;

//畅捷通工具类
class ChanjetFinanceReportConfig {
    public static $Field =
    [
        //采购发票
        "TplusPurchaseInvoice" =>[
            "config"=> [
                "code" => "PurchaseInvoice",
                "Model" => "TplusPurchaseInvoice",
                "ListModel" => "TplusPurchaseInvoice",
                "InfoModel" => "TplusPurchaseInvoiceInfo",
                "queryApi" => "PurchaseInvoiceOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "PurchaseInvoice.ID",
                    "voucher_code" => "PurchaseInvoice.Code",
                    "voucher_date" => "PurchaseInvoice.VoucherDate",
                    "voucher_time|datetime" => "PurchaseInvoice.VoucherDate",

                    "invoice_type" => "PurchaseInvoice.InvoiceType.Name",
                    "partner_name" => "PurchaseInvoice.Partner.Name",
                    "clerk_name" => "PurchaseInvoice.Clerk.Name",
                    "payment_method" => "PurchaseInvoice.PayType.Name",
                    "carship_no" => "PurchaseInvoice.pubuserdefnvc1",
                    "source_voucher_code" => "PurchaseInvoice.SourceVoucherCode",
                ],
                "infoField" => [
                    "voucher_id" => "PurchaseInvoice.ID",

                    "warehouse_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Warehouse.Name",
                    "inventory_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Inventory.Name",
                    "archive_spec" => "PurchaseInvoice.PurchaseInvoiceDetails.Inventory.Specification",

                    "unit_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Unit.Name",
                    "quantity|int" => "PurchaseInvoice.PurchaseInvoiceDetails.Quantity",
                    "price|decimal" => "PurchaseInvoice.PurchaseInvoiceDetails.OrigDiscountPrice",
                    "taxRate|rate" => "PurchaseInvoice.PurchaseInvoiceDetails.TaxRate",
                    "OrigTaxPrice|decimal" => "PurchaseInvoice.PurchaseInvoiceDetails.OrigTaxPrice",
                    "OrigTaxAmount|decimal" => "PurchaseInvoice.PurchaseInvoiceDetails.OrigTaxAmount",

                    "steel_factory_name" => "PurchaseInvoice.PurchaseInvoiceDetails.pubuserdefnvc1",
                    "material_name" => "PurchaseInvoice.PurchaseInvoiceDetails.pubuserdefnvc2",
                    "breed_name" => "PurchaseInvoice.PurchaseInvoiceDetails.pubuserdefnvc3",
                ]
            ]
        ],
        //销售发票
        "TplusSaleInvoice" =>[
            "config"=> [
                "code" => "SaleInvoice",
                "Model" => "TplusSaleInvoice",
                "ListModel" => "TplusSaleInvoice",
                "InfoModel" => "TplusSaleInvoiceInfo",
                "queryApi" => "SaleInvoiceOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "SaleInvoice.ID",
                    "voucher_code" => "SaleInvoice.Code",
                    "voucher_date" => "SaleInvoice.VoucherDate",
                    "voucher_time|datetime" => "SaleInvoice.VoucherDate",

                    "clerk_name" => "SaleInvoice.Clerk.Name",
                    "settle_customer" => "SaleInvoice.SettleCustomer.Name",

                    "customer" => "SaleInvoice.Customer.Name",
                    "pay_method" => "SaleInvoice.ReciveType.Name",
                    "delivery_man" => "SaleInvoice.SendPerson.Name",
                    "delivery_date" => "SaleInvoice.SendDate",

                    "invoice_type" => "SaleInvoice.InvoiceType.Name",
                    "carship_no" => "SaleInvoice.pubuserdefnvc1",
                    "source_voucher_code" => "SaleInvoice.SourceVoucherCode",
                ],
                "infoField" => [
                    "voucher_id" => "SaleInvoice.ID",
                    //"warehouse_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Warehouse.Name", 仓库名
                    "inventory_name" => "SaleInvoice.SaleInvoiceDetails.Inventory.Name",
                    "archive_spec" => "SaleInvoice.SaleInvoiceDetails.Inventory.Specification",
                    "unit" => "SaleInvoice.SaleInvoiceDetails.Unit.Name",
                    "quantity|float:4" => "SaleInvoice.SaleInvoiceDetails.Quantity",
                    "taxRate|rate" => "SaleInvoice.SaleInvoiceDetails.TaxRate",
                    "OrigTaxPrice|decimal" => "SaleInvoice.SaleInvoiceDetails.OrigTaxPrice",
                    "OrigTaxAmount|decimal" => "SaleInvoice.SaleInvoiceDetails.OrigTaxAmount",

                    "steel_factory_name" => "SaleInvoice.SaleInvoiceDetails.pubuserdefnvc1",
                    "material_name" => "SaleInvoice.SaleInvoiceDetails.pubuserdefnvc2",
                    "breed_name" => "SaleInvoice.SaleInvoiceDetails.pubuserdefnvc3",
                    "size_model" => "SaleInvoice.SaleInvoiceDetails.Inventory.Specification",
                    "price|decimal" => "SaleInvoice.SaleInvoiceDetails.OrigDiscountPrice",
                    "accrual|decimal" => "SaleInvoice.SaleInvoiceDetails.pubuserdefdecm1",
                    "transport_diff|decimal" => "SaleInvoice.SaleInvoiceDetails.pubuserdefdecm2",
                    "inventory_diff|decimal" => "SaleInvoice.SaleInvoiceDetails.pubuserdefdecm3",
                    "performance|decimal" => "SaleInvoice.SaleInvoiceDetails.pubuserdefdecm4",
                    "remark" => "SaleInvoice.SaleInvoiceDetails.Memo",
                    "quantity2|int" => "SaleInvoice.SaleInvoiceDetails.Quantity2",
                    "stock_id" => "SaleInvoice.SaleInvoiceDetails.priuserdefnvc2",
                ]
            ]
        ],
        //其他入库单
        "TplusOtherInboundOrder" =>[
            "config"=> [
                "code" => "RDRecord",
                "Model" => "TplusOtherInboundOrder",
                "ListModel" => "TplusOtherInboundOrder",
                "InfoModel" => "TplusOtherInboundOrderInfo",
                "queryApi" => "OtherReceiveOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "RDRecord.ID",
                    "voucher_code" => "RDRecord.Code",
                    "voucher_date" => "RDRecord.VoucherDate",
                    "voucher_time|datetime" => "RDRecord.VoucherDate",

                    "business_type" => "RDRecord.BusiType.Name",
                    "partner_name" => "RDRecord.Partner.Name",
                    "carship_no" => "RDRecord.pubuserdefnvc1", //车船号  暂无

                    "document_makers" => "RDRecord.Maker",
                    "document_auditor" => "RDRecord.Auditor",
                    "packing_count" => "RDRecord.RDRecordDetails.PackingCount",
                    "packing_unit" => "RDRecord.RDRecordDetails.UnitByPacking.Name",
                    "packing_capacity" => "RDRecord.RDRecordDetails.PackingCapacity",
                ],
                "infoField" => [
                    "voucher_id" => "RDRecord.ID",
                    "warehouse_name" => "RDRecord.RDRecordDetails.Warehouse.Name",
                    "inventory_name" => "RDRecord.RDRecordDetails.Inventory.Name",
                    "inventory_no" => "RDRecord.RDRecordDetails.Inventory.Code",
                    "size_model" => "RDRecord.RDRecordDetails.Inventory.Specification",

                    "unit" => "RDRecord.RDRecordDetails.Unit.Name",
                    //"current_quantity" => "RDRecord.RDRecordDetails.current_quantity",
                    //"current_quantity_desc" => "RDRecord.RDRecordDetails.current_quantity_desc", //金额

                    "price|decimal" => "RDRecord.RDRecordDetails.Price",
                    "amount|decimal" => "RDRecord.RDRecordDetails.Amount", //金额

                    "steel_factory_name" => "RDRecord.RDRecordDetails.pubuserdefnvc1",
                    "material_name" => "RDRecord.RDRecordDetails.pubuserdefnvc3",
                    "breed_name" => "RDRecord.RDRecordDetails.pubuserdefnvc2",

                    "quantity|float:4" => "RDRecord.RDRecordDetails.Quantity",
                    "quantity2|int" => "RDRecord.RDRecordDetails.Quantity2",
                ]
            ]
        ],
        //其他出库单
        "TplusOtherOutboundOrder" =>[
            "config"=> [
                "code" => "RDRecord",
                "Model" => "TplusOtherOutboundOrder",
                "ListModel" => "TplusOtherOutboundOrder",
                "InfoModel" => "TplusOtherOutboundOrderInfo",
                "queryApi" => "OtherDispatchOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "RDRecord.ID",
                    "voucher_code" => "RDRecord.Code",
                    "voucher_date" => "RDRecord.VoucherDate",
                    "voucher_time|datetime" => "RDRecord.VoucherDate",

                    "business_type" => "RDRecord.BusiType.Name",
                    "document_makers" => "RDRecord.Maker",
                    "document_auditor" => "RDRecord.Auditor",
                    "inbound_quantity" => "RDRecord.RDRecordDetails.CumMarshalStockInQuantity",
                    "loss_quantity" => "RDRecord.RDRecordDetails.DifferenceQuantity",
                ],
                "infoField" => [
                    "voucher_id" => "RDRecord.ID",
                    "warehouse_name" => "RDRecord.RDRecordDetails.Warehouse.Name",
                    "steel_factory_name" => "RDRecord.RDRecordDetails.pubuserdefnvc1",
                    "breed_name" => "RDRecord.RDRecordDetails.pubuserdefnvc2",
                    "material_name" => "RDRecord.RDRecordDetails.pubuserdefnvc3",

                    "inventory_name" => "RDRecord.RDRecordDetails.Inventory.Name",
                    "inventory_no" => "RDRecord.RDRecordDetails.Inventory.Code",
                    "size_model" => "RDRecord.RDRecordDetails.Inventory.Specification",
                    "unit" => "RDRecord.RDRecordDetails.Unit.Name",
                    "quantity|float:4" => "RDRecord.RDRecordDetails.Quantity",
                    "quantity2|int" => "RDRecord.RDRecordDetails.quantity2",
                    "price|decimal" => "RDRecord.RDRecordDetails.Price",
                    "amount|decimal" => "RDRecord.RDRecordDetails.Amount",
//                    "current_quantity" => "RDRecord.RDRecordDetails.Amount",
//                    "current_quantity_desc" => "RDRecord.RDRecordDetails.Amount",

                ]
            ]
        ],
        //入库调整单
        "TplusInboundAdjustmentOrder" =>[
            "config"=> [
                "code" => "AdjustCostVoucher",
                "Model" => "TplusInboundAdjustmentOrder",
                "ListModel" => "TplusInboundAdjustmentOrder",
                "InfoModel" => "TplusInboundAdjustmentOrderInfo",
                "queryApi" => "AdjustCostInOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "AdjustCostVoucher.ID",
                    "voucher_code" => "AdjustCostVoucher.Code",
                    "voucher_date" => "AdjustCostVoucher.VoucherDate",
                    "voucher_time|datetime" => "AdjustCostVoucher.VoucherDate",

                    "business_type" => "AdjustCostVoucher.AdjustType.Name",
                    "partner_name" => "AdjustCostVoucher.Partner.Name",
                    "warehouse_name" => "AdjustCostVoucher.Warehouse.Name",
                    "carship_no" => "AdjustCostVoucher.pubuserdefnvc1", //车船号  暂无
                ],
                "infoField" => [
                    "voucher_id" => "AdjustCostVoucher.ID",

                    "inventory_name" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Name",
                    "steel_factory_name" => "AdjustCostVoucher.AdjustCostDetails.pubuserdefnvc1",//钢厂
                    "material_name" => "AdjustCostVoucher.AdjustCostDetails.pubuserdefnvc3",//材质
                    "breed_name" => "AdjustCostVoucher.AdjustCostDetails.pubuserdefnvc2",//品种

                    "size_model" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Specification",//规格型号
//                    "assoc_document_no" => "AdjustCostVoucher.AdjustCostDetails.SourceVoucherCode",//关联单号
//                    "assoc_document" => "AdjustCostVoucher.SourceVoucherType.Name",//关联单据
                    "amount" => "AdjustCostVoucher.AdjustCostDetails.Amount",//金额
//
//
//        "accrual" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Name",//计提
//        "freight_diff" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Name",//运差
//        "good_diff" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Name",//货差
//        "achieve" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Name",//业绩
                ]
            ]
        ],
        //出库调整单
        "TplusOutboundAdjustmentOrder" =>[
            "config"=> [
                "code" => "AdjustCostVoucher",
                "Model" => "TplusOutboundAdjustmentOrder",
                "ListModel" => "TplusOutboundAdjustmentOrder",
                "InfoModel" => "TplusOutboundAdjustmentOrderInfo",
                "queryApi" => "AdjustCostOutOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "AdjustCostVoucher.ID",
                    "voucher_code" => "AdjustCostVoucher.Code",
                    "voucher_date" => "AdjustCostVoucher.VoucherDate",
                    "voucher_time|datetime" => "AdjustCostVoucher.VoucherDate",

                    "business_type" => "AdjustCostVoucher.AdjustType.Name",
                    "customer_name" => "AdjustCostVoucher.Partner.Name",
                    "warehouse_name" => "AdjustCostVoucher.Warehouse.Name"
                ],
                "infoField" => [
                    "voucher_id" => "AdjustCostVoucher.ID",

                    "inventory_name" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Name",
                    "warehouse_name" => "AdjustCostVoucher.AdjustCostDetails.Warehouse.Name",
                    "size_model" => "AdjustCostVoucher.AdjustCostDetails.Inventory.Specification",
                    "assoc_document_no" => "AdjustCostVoucher.AdjustCostDetails.SourceVoucherCode",
                    "assoc_document" => "AdjustCostVoucher.AdjustCostDetails.SourceVoucherType.Name",
                    "remain_quantity|int" => "AdjustCostVoucher.AdjustCostDetails.BalanceQuantity",
                    "before_adjust_price|decimal"=>"AdjustCostVoucher.AdjustCostDetails.BalancePrice",//调前单价
                    "before_adjust_amount|decimal"=>"AdjustCostVoucher.AdjustCostDetails.BalanceAmount",//调前金额
                    "after_adjust_price|decimal"=>"AdjustCostVoucher.AdjustCostDetails.AdjustedPrice",//调后单价
                    "after_adjust_amount|decimal"=>"AdjustCostVoucher.AdjustCostDetails.AdjustedAmount",//调后金额
                    "steel_factory_name" => "AdjustCostVoucher.AdjustCostDetails.pubuserdefnvc1",
                    "breed_name" => "AdjustCostVoucher.AdjustCostDetails.pubuserdefnvc2",
                    "material_name" => "AdjustCostVoucher.AdjustCostDetails.pubuserdefnvc3",
                ]
            ]
        ],
        //调拨单
        "TplusTransferOrder" =>[
            "config"=> [
                "code" => "TransVoucher",
                "Model" => "TplusTransferOrder",
                "ListModel" => "TplusTransferOrder",
                "InfoModel" => "TplusTransferOrderInfo",
                "queryApi" => "TransVoucherOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "TransVoucher.ID",
                    "voucher_code" => "TransVoucher.Code",
                    "voucher_date" => "TransVoucher.VoucherDate",
                    "voucher_time|datetime" => "TransVoucher.VoucherDate",

                    "business_type" => "TransVoucher.BusiType.Name",
                    "bring_warehouse" => "TransVoucher.OutWarehouse.Name",//调出仓库名称
                    "pull_warehouse" => "TransVoucher.InWarehouse.Name",//调入仓库名称
                    "inventory_name" => "TransVoucher.TransDetails.Inventory.Name",
                    "size_model" => "TransVoucher.TransDetails.Inventory.Specification",
                    "unit" => "TransVoucher.TransDetails.Unit.Name",
                    "quantity|int" => "TransVoucher.TransDetails.Quantity",
                    "out_amount|decimal" => "TransVoucher.TotalOutAmount",
                    "in_amount|decimal" => "TransVoucher.TotalInAmount",
                ],
                "infoField" => [
                    "voucher_id" => "TransVoucher.ID",
                    "inventory_name" => "TransVoucher.TransDetails.Inventory.Name",
                    "inventory_no" => "TransVoucher.TransDetails.Inventory.Code",
                    "size_model" => "TransVoucher.TransDetails.Inventory.Specification",//规格型号
                    "unit" => "TransVoucher.TransDetails.Unit.Name",
                    "quantity|int" => "TransVoucher.TransDetails.Quantity",
                    "quantity2|int" => "TransVoucher.TransDetails.Quantity2",
                    "out_amount|decimal" => "TransVoucher.TransDetails.OutAmount",
                    //"bring_warehouse_desc" => "TransVoucher.TransDetails.Quantity2",//调出仓库现存量说明
                    "steel_factory_name" => "TransVoucher.TransDetails.pubuserdefnvc1",
                    "breed_name" => "TransVoucher.TransDetails.pubuserdefnvc2",
                    "material_name" => "TransVoucher.TransDetails.pubuserdefnvc3",
                ]
            ]
        ],
        //收款单明细
        "TplusReceiptOrder" =>[
            "config"=> [
                "ReportName" => "ARAP_ReceiveVoucherDetailRpt",
                "code" => "report",
                "Model" => "TplusReceiptOrder",
                "ListModel" => "TplusReceiptOrder",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_code" => "VoucherCode",
                    "voucher_date" => "VoucherDate",
                    "voucher_time|datetime" => "VoucherDate",
                    "settle_customer" => "partnerName",
                    "department_name" => "departmentName",
                    "clerk_name" => "personName",
                    "payment_time" => "settleTimeName",//结款时机
                    "project_class_name" => "ProjectClassName",//项目分类
                    "writeoff_status" => "cancelStateName",//核销状态
                    "discount" => "origAllowances",//折让
                    "settle_method" => "settleStyleName",//结算方式
                    "account" => "bankAccountCode",//账号
                    "account_name" => "bankAccountName",//账号名
                    "ticket_no" => "documentCode",//票据号
                    "payout_amount|decimal" => "settleDetailAmount",//收款金额
                    "document_makers" => "maker",//制单人
                    "remark" => "memo",
                    "create_at|datetime" => "CreatedTime",
                ],
            ]
        ],
        //付款单明细
        "TplusPaymentOrder" =>[
            "config"=> [
                "ReportName" => "ARAP_PaymentVoucherDetailRpt",
                "code" => "report",
                "Model" => "TplusPaymentOrder",
                "ListModel" => "TplusPaymentOrder",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_code" => "VoucherCode",
                    "voucher_date" => "VoucherDate",
                    "voucher_time|datetime" => "VoucherDate",
                    "partner_name" => "partnerName",
                    "other_party_bank" => "partnerAccBankName",
                    "other_party_bank_no" => "partnerBankAccount",
                    "department_name" => "departmentName",
                    "clerk_name" => "personName",
                    "payment_time" => "settleTimeName",
                    "project_class_name" => "ProjectClassName",
                    "writeoff_status" => "cancelStateName",
                    "discount" => "allowances",
                    "settle_method" => "settleStyleName",
                    "account" => "bankAccountCode",
                    "account_name" => "bankAccountName",
                    "ticket_no" => "documentCode",
                    "payout_amount" => "origSettleDetailAmount",
                    "document_makers" => "maker",
                    "remark" => "memo",
                    "create_at|datetime" => "CreatedTime"
                ],
            ]
        ],
        //收款单列表
        "TplusReceiptOrderList" =>[
            "config"=> [
                "code" => "ArapReceivePayment",
                "Model" => "TplusReceiptOrderList",
                "ListModel" => "TplusReceiptOrderList",
                "InfoModel" => "TplusReceiptOrderListInfo",
                "queryApi" => "ReceiveVoucherOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "ArapReceivePayment.ID",
                    "voucher_code" => "ArapReceivePayment.Code",
                    "voucher_date" => "ArapReceivePayment.VoucherDate",
                    "voucher_time|datetime" => "ArapReceivePayment.VoucherDate",
                    "partner_code" => "ArapReceivePayment.Partner.Code",
                    "partner_name" => "ArapReceivePayment.Partner.Name",
                    "business_type" => "ArapReceivePayment.VoucherType.Name",
                ],
                "infoField" => [
                    "voucher_id" => "ArapReceivePayment.ID",
                    "settle_method" => "ArapReceivePayment.SettleStyle.Name",
                    "bank_account" => "ArapReceivePayment.BankAccount.Name",
                    "amount|decimal" => "ArapReceivePayment.OrigAmount",
                ]
            ]
        ],
        //付款单列表
        "TplusPaymentOrderList" =>[
            "config"=> [
                "code" => "ArapReceivePayment",
                "Model" => "TplusPaymentOrderList",
                "ListModel" => "TplusPaymentOrderList",
                "InfoModel" => "TplusPaymentOrderListInfo",
                "queryApi" => "PaymentVoucherOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "ArapReceivePayment.ID",
                    "voucher_code" => "ArapReceivePayment.Code",
                    "voucher_date" => "ArapReceivePayment.VoucherDate",
                    "voucher_time|datetime" => "ArapReceivePayment.VoucherDate",

                    "partner_name" => "ArapReceivePayment.Partner.Name",
                    "partner_code" => "ArapReceivePayment.Partner.Code",
                    "business_type" => "ArapReceivePayment.BusiType.Name",
                ],
                "infoField" => [
                    "voucher_id" => "ArapReceivePayment.ID",
                    "settle_method" => "ArapReceivePayment.SettleStyle.Name",
                    "bank_account" => "ArapReceivePayment.BankAccount.Name",
                    "amount|decimal" => "ArapReceivePayment.OrigAmount",
                ]
            ]
        ],
        //盘点单
        "TplusCountOrder" =>[
            "config"=> [
                "code" => "CheckVoucher",
                "model" => "TplusCountOrder",
                "ListModel" => "TplusCountOrder",
                "InfoModel" => "TplusCountOrderInfo",
                "queryApi" => "CheckVoucherOpenApiFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "CheckVoucher.ID",
                    "voucher_code" => "CheckVoucher.Code",
                    "voucher_date" => "CheckVoucher.VoucherDate",
                    "voucher_time|datetime" => "CheckVoucher.VoucherDate",
                    "account_date|datetime" => "CheckVoucher.VoucherDateInStock",
                    "count_date|datetime" => "CheckVoucher.VoucherDate",
                    "warehouse_name" => "CheckVoucher.Warehouse.Name",
                    "out_warehouse_type" => "CheckVoucher.DispatchStyle.Name",
                    "in_warehouse_type" => "CheckVoucher.ReceiveStyle.Name",
                ],
                "infoField" => [
                    "voucher_id" => "CheckVoucher.ID",
                    "inventory_name" => "CheckVoucher.CheckDetails.Inventory.Name",
                    "size_model" => "CheckVoucher.CheckDetails.Inventory.Specification",
                    "unit" => "CheckVoucher.CheckDetails.Unit.Name",
                    "account_quantity|float:4" => "CheckVoucher.CheckDetails.QuantityInStock",
                    "count_quantity|float:4" => "CheckVoucher.CheckDetails.Quantity",
                    "breakeven_amount|decimal" => "CheckVoucher.CheckDetails.BalanceAmount",
                    "breakeven_quantity|float:4" => "CheckVoucher.CheckDetails.BalanceQuantity",
                    "price|decimal" => "CheckVoucher.CheckDetails.Price",
                    "steel_factory_name" => "CheckVoucher.CheckDetails.pubuserdefnvc1",
                    "breed_name" => "CheckVoucher.CheckDetails.pubuserdefnvc2",
                    "material_name" => "CheckVoucher.CheckDetails.pubuserdefnvc3",
                ]
            ]
        ],
        //采购费用分摊单
        "TplusFeeCostShare" =>[
            "config"=> [
                "code" => "ArapStrikeBalance",
                "Model" => "TplusFeeCostShare",
                "ListModel" => "TplusFeeCostShare",
//                "InfoModel" => "",
//                "Info2Model" => "",
//                "queryApi" => "",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "ArapStrikeBalance.ID",
                    "voucher_code" => "ArapStrikeBalance.Code",
                    "voucher_date" => "ArapStrikeBalance.VoucherDate",
                    "voucher_time|datetime" => "ArapStrikeBalance.VoucherDate",

                    "business_type" => "ArapStrikeBalance.BusiType.Name",
                    "bring_warehouse" => "ArapStrikeBalance.OutWarehouse.Name",//调出仓库名称
                    "pull_warehouse" => "ArapStrikeBalance.InWarehouse.Name",//调入仓库名称
                ],
                "infoField" => [
                    "voucher_id" => "ArapStrikeBalance.ID",

                ],
                "info2Field" => [
                    "voucher_id" => "ArapStrikeBalance.ID",

                ],
            ]
        ],
        //应收总账
        "TplusReceiveLedger" =>[
            "config"=> [
                "ReportName" => "ARAP_ReceiveAccountSumRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusReceiveLedger",
                "ListModel" => "TplusReceiveLedger",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
//                    "voucher_id" => "ID",
//                    "voucher_code" => "Code",
                    "voucher_date" => "voucherDate",
                    "voucher_time|datetime" => "voucherDate",
                    "settle_customer" => "partnerName",
                    "open_balance|decimal" => "origPeriodAmount",
                    "should_charged|decimal" => "origAmount",
                    "has_charged|decimal" => "origSettleAmount",
                    "close_balance|decimal" => "origBalanceAmount",
                ],
            ]
        ],
        //应收明细
        "TplusReceiveDetail" =>[
            "config"=> [
                "ReportName" => "ARAP_ReceiveAccountDetailRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusReceiveDetail",
                "ListModel" => "TplusReceiveDetail",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_code" => "voucherCode",
                    "voucher_date" => "voucherDate",
                    "voucher_type" => "voucherTypeName",
                    "voucher_time|datetime" => "voucherDate",
                    "settle_customer" => "partnerName",
                    "customer_name" => "noSettlepartnerName",
                    "department_name" => "departmentName",
                    "clerk_name" => "personName",
                    "remark" => "memo",
                    "should_charged|decimal" => "origAmount",
                    "has_charged|decimal" => "origSettleAmount",
                    "balance|decimal" => "origBalanceAmount",
                ],
            ]
        ],
        //应付总账
        "TplusPaymentLedger" =>[
            "config"=> [
                "ReportName" => "ARAP_PaymentAccountSumRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusPaymentLedger",
                "ListModel" => "TplusPaymentLedger",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
//                    "voucher_code" => "voucherCode",
//                    "voucher_date" => "voucherDate",
//                    "voucher_time" => "voucherDate",
                    "partner_category" => "partnerClassName",
                    "partner_name" => "partnerName",
                    "open_balance|decimal" => "origPeriodAmount",
                    "should_payment|decimal" => "origAmount",
                    "has_payment|decimal" => "origSettleAmount",
                    "close_balance|decimal" => "origBalanceAmount",

                ],
            ]
        ],
        //存货明细
        "TplusInventoryInfo" =>[
            "config"=> [
                "ReportName" => "ST_RDSInventoryDetailRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusInventoryInfo",
                "ListModel" => "TplusInventoryInfo",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_code" => "VoucherCode",
                    "voucher_date" => "VoucherDate",
                    "voucher_time|datetime" => "VoucherDate",
                    "voucher_type" =>"VoucherType",
                    "in_date" => "Period",
                    "business_type" => "BusinessType",
                    "warehouse_no" => "WarehouseCode",
                    "warehouse_name" => "Warehouse",
                    "inventory_no" => "InventoryCode",
                    "inventory_name" => "Inventory",
                    "size_model" => "Specification",
                    "unit" => "BaseUnit",
                    "inventory_class" => "InventoryClass",
                    "certificate" => "docno",
                    "correspondents" => "Partner",

                    "revenue_num|float:4" => "ArrivalBaseQuantity|[ReceiveColumn-收入][ArrivalBaseQuantity-数量]",
                    "revenue_price|decimal" => "ArrivalPrice|[ReceiveColumn-收入][ArrivalPrice-单价]",
                    "revenue_amount|decimal" => "ArrivalAmount|[ReceiveColumn-收入][ArrivalAmount-金额]",

                    "emit_num|float:4" => "DispatchBaseQuantity|[DispatchColumn-发出][DispatchBaseQuantity-数量]",
                    "emit_price|decimal" => "DispatchPrice|[DispatchColumn-发出][DispatchPrice-单价]",
                    "emit_amount|decimal" => "DispatchAmount|[DispatchColumn-发出][DispatchAmount-金额]",

                    "balance_num|float:4" => "BaseQuantity|[StockColumn-结存][BaseQuantity-数量]",
                    "balance_price|decimal" => "Price|[StockColumn-结存][Price-单价]",
                    "balance_amount|decimal" => "Amount|[StockColumn-结存][Amount-金额]",

                ],
            ]
        ],
        //应付明细
        "TplusPaymentDetail" =>[
            "config"=> [
                "ReportName" => "ARAP_PaymentAccountDetailRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusPaymentDetail",
                "ListModel" => "TplusPaymentDetail",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_code" => "voucherCode",
                    "voucher_date" => "voucherDate",
                    "voucher_time|int" => "voucherDate",
                    "voucher_type" => "voucherTypeName",
                    "partner_name" => "partnerName",
                    "department_name" => "departmentName",
                    "clerk_name" => "personName",
                    "remark" => "memo",
                    "should_payment|decimal" => "origAmount", //orig可能多余 Amount
                    "has_payment|decimal" => "origSettleAmount",//SettleAmount
                    "balance|decimal" => "origBalanceAmount",//BalanceAmount
                ],
            ]
        ],
        //存货总账
        "TplusInventoryLedger" =>[
            "config"=> [
                "ReportName" => "ST_RDSInventoryTotalRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusInventoryLedger",
                "ListModel" => "TplusInventoryLedger",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
//                    "voucher_code" => "voucherCode",
//                    "voucher_date" => "voucherDate",
//                    "voucher_time|int" => "voucherDate",
                    //"voucher_type" => "voucherTypeName",
                    "warehouse_no" => "WarehouseCode",
                    "warehouse_name" => "Warehouse",
                    "inventory_class" => "InventoryClass_lev1",
                    "inventory_no" => "InventoryCode",
                    "inventory_name" => "Inventory",
                    "size_model" => "Specification",
                    "unit" => "BaseUnit",

                    "open_balance_num|float:4" => "BeginBaseQuantity|[PeriodStartColumn-期初结存][BeginBaseQuantity-数量]",
                    "open_balance_price|decimal" => "BeginPrice|[PeriodStartColumn-期初结存][BeginPrice-平均单价]",
                    "open_balance_amount|decimal" => "BeginAmount|[PeriodStartColumn-期初结存][BeginAmount-金额]",

                    "current_revenue_num|float:4" => "ArrivalBaseQuantity|[ArrivalColumn-本期收入][ArrivalBaseQuantity-数量]",
                    "current_revenue_price|decimal" => "ArrivalPrice|[ArrivalColumn-本期收入][ArrivalPrice-平均单价]",
                    "current_revenue_amount|decimal" => "ArrivalAmount|[ArrivalColumn-本期收入][ArrivalAmount-金额]",

                    "current_emit_num|float:4" => "DispatchBaseQuantity|[DispatchColumn-本期发出][DispatchBaseQuantity-数量]",
                    "current_emit_price|decimal" => "DispatchPrice|[DispatchColumn-本期发出][DispatchPrice-平均单价]",
                    "current_emit_amount|decimal" => "DispatchAmount|[DispatchColumn-本期发出][DispatchAmount-金额]",

                    "balance_num|float:4" => "BaseQuantity|[StockColumn-期末结存][BaseQuantity-数量]",
                    "balance_price|decimal" => "Price|[StockColumn-期末结存][Price-平均单价]",
                    "balance_amount|decimal" => "Amount|[StockColumn-期末结存][Amount-金额]",
                ],
            ]
        ],
        //呆滞存货分析
        "TplusSluggishInventoryAnalysis" =>[
            "config"=> [
                "ReportName" => "ST_ObsoleteMaterialRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusSluggishInventoryAnalysis",
                "ListModel" => "TplusSluggishInventoryAnalysis",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "analysis_date" => "VoucherDate",
                    //"sluggish_standard" => "ObsoleteDays",
                    "warehouse_no" => "WarehouseCode",
                    "warehouse_name" => "Warehouse",
                    "inventory_no" => "InventoryCode",
                    "inventory_name" => "Inventory",
                    "size_model" => "Specification",
                    "main_unit" => "BaseUnit",
                    "quantity|float:4" => "BaseQuantity",
                    "price|decimal" => "Price",
                    "stock_amount|decimal" => "Amount",
                    "last_change_time" => "LastBusinessDate",
                    "sluggish_day" => "ObsoleteDays",
                    "sluggish_rate|rate" => "ObsoleteRate",
                ],
            ]
        ],
        //库存周转率分析
        "TplusInventoryTurnoverAnalysis" =>[
            "config"=> [
                "ReportName" => "ST_MaterialTurnoverRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusInventoryTurnoverAnalysis",
                "ListModel" => "TplusInventoryTurnoverAnalysis",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
//                    "voucher_code" => "voucherCode",
//                    "voucher_date" => "voucherDate",
//                    "voucher_time|datetime" => "voucherDate",
                    //"voucher_type" => "voucherTypeName",
                    "analysis_date" => "voucherDate",
                    "warehouse_no" => "WarehouseCode",
                    "warehouse_name" => "Warehouse",

                    "inventory_class" => "InventoryClass|InventoryClass_lev1",
                    "inventory_no" => "InventoryCode",
                    "inventory_name" => "Inventory",

                    "standard_turn_day" => "standardturnoverdays",
                    "size_model" => "Specification",
                    "main_unit" => "BaseUnit",
                    "quantity|float:4" => "BaseQuantity",
                    "stock_amount|decimal" => "Amount",
                    "turn_rate" => "TurnoverRate",
                    "turn_day" => "TurnoverDays",
                    "diff" => "TurnoverDiff",
                ],
            ]
        ],
        //库龄分析
        "TplusInventoryAgeAnalysis" =>[
            "config"=> [
                "ReportName" => "ST_StockAgeRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusInventoryAgeAnalysis",
                "ListModel" => "TplusInventoryAgeAnalysis",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_date" => "VoucherDate",
                    "voucher_time|datetime" => "VoucherDate",
                    "warehouse_name" => "Warehouse",
                    "inventory_no" => "InventoryCode",
                    "inventory_name" => "Inventory",
                    "size_model" => "Specification",
                    //"unit" => "BaseUnit",
                    "main_unit" => "BaseUnit",
                    "latest_outbound_date" => "LastDispatchDate",
                    "detail_30_num|float:4" => "BaseQuantity0|[BeginColumn0-0-30天][BaseQuantity0-数量]",
                    "detail_30_amount|decimal" => "Amount0|[BeginColumn0-0-30天][Amount0-库存金额]",
                    "detail_60_num|float:4" => "BaseQuantity1|[BeginColumn1-31-60天][BaseQuantity1-数量]",
                    "detail_60_amount|decimal" => "Amount1|[BeginColumn1-31-60天][Amount1-库存金额]",
                    "detail_90_num|float:4" => "BaseQuantity2|[BeginColumn2-61-90天][BaseQuantity2-数量]",
                    "detail_90_amount|decimal" => "Amount2|[BeginColumn2-61-90天][Amount2-库存金额]",
                    "detail_120_num|float:4" => "BaseQuantity3|[BeginColumn3-91-120天][BaseQuantity3-数量]",
                    "detail_120_amount|decimal" => "Amount3|[BeginColumn3-91-120天][Amount3-库存金额]",
                    "detail_150_num|float:4" => "BaseQuantity4|[BeginColumn4-120天以上][BaseQuantity4-数量]",
                    "detail_150_amount|decimal" => "Amount4|[BeginColumn4-120天以上][Amount4-库存金额]",
                    "detail_total_num|float:4" => "BaseQuantity|[Total-合计][BaseQuantity-数量]",
                    "detail_total_amount|decimal" => "Amount|[Total-合计][Amount-库存金额]",
                ],
            ]
        ],
        //销售毛利分析
        "TplusSaleGrossProfitAnalysis" =>[
            "config"=> [
                "ReportName" => "SA_GrossProfitAnalysisRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusSaleGrossProfitAnalysis",
                "ListModel" => "TplusSaleGrossProfitAnalysis",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_date" => "voucherDate",
                    "voucher_time|datetime" => "voucherDate",
                    "voucher_code" =>"saleDeliveryCode",//GroupSaleDeliveryCode
                    "settle_customer" => "SettleCustomer",
                    "amount|decimal" => "discountAmount",
                    "tax" => "tax",
                    "taxAmount|decimal" => "taxAmount",
                    "accrued_rece_writeoff_amount|decimal" => "newReceiveAmount",
                    "discount|decimal" => "allowancesAmount",
                    "have_outbound_cost|decimal" => "rdRecordCostAmount",
                    "no_outbound_cost|decimal" => "noRDRecordCostAmount",
                    "total_cost|decimal" => "CostAmount",
                    "fee_cost_share|decimal" => "expenseAmount",
                    "no_fee_cost_share|decimal" => "noExpenseAmount",
                    "total_fee|decimal" => "totalExpenseAmount",
                    "gross_profit|decimal" => "grossProfit",
                    "gross_profit_rate|rate" => "grossProfitRate",
                ],
            ]
        ],
        //销售毛利汇总
        "TplusSaleGrossProfitAnalysisSummary" =>[
            "config"=> [
                "ReportName" => "SA_GrossProfitAnalysisRpt",
                "code" => "report",//报表类,查询条件不需要拼接
                "Model" => "TplusSaleGrossProfitAnalysisSummary",
                "ListModel" => "TplusSaleGrossProfitAnalysisSummary",
                "queryApi" => "reportQueryGetReportData",
            ],
            "Field" => [
                "listField" => [
                    "voucher_date" => "voucherDate",
                    "voucher_time|datetime" => "voucherDate",
                    "voucher_code" =>"saleDeliveryCode",//GroupSaleDeliveryCode
                    "settle_customer" => "SettleCustomer",
                    "amount|decimal" => "discountAmount",
                    "tax" => "tax",
                    "taxAmount|decimal" => "taxAmount",
                    "accrued_rece_writeoff_amount|decimal" => "newReceiveAmount",
                    "discount|decimal" => "allowancesAmount",
                    "have_outbound_cost|decimal" => "rdRecordCostAmount",
                    "no_outbound_cost|decimal" => "noRDRecordCostAmount",
                    "total_cost|decimal" => "CostAmount",
                    "fee_cost_share|decimal" => "expenseAmount",
                    "no_fee_cost_share|decimal" => "noExpenseAmount",
                    "total_fee|decimal" => "totalExpenseAmount",
                    "gross_profit|decimal" => "grossProfit",
                    "gross_profit_rate|rate" => "grossProfitRate",
                ],
            ]
        ],
        //费用单
        "TplusExpenseVoucher" =>[
            "config"=> [
                "code" => "ExpenseVoucher",
                "Model" => "TplusExpenseVoucher",
                "ListModel" => "TplusExpenseVoucher",
                "InfoModel" => "TplusExpenseVoucherInfo",
                "queryApi" => "expenseVoucherFindVoucherList",
            ],
            "Field" => [
                "listField" => [
                    "voucher_id" => "ExpenseVoucher.ID",
                    "voucher_code" => "ExpenseVoucher.Code",
                    "voucher_date" => "ExpenseVoucher.VoucherDate",
                    "voucher_time|datetime" => "ExpenseVoucher.VoucherDate",

                    "business_type" => "ExpenseVoucher.BusinessType.Name",
                    "bill_type" => "ExpenseVoucher.BillType.Name",//票据类型
                    "company_name_abbreve" => "ExpenseVoucher.Partner.PartnerAbbName",//往来单位简称
                    "company_name" => "ExpenseVoucher.Partner.Name",//往来单位名称
                    "company_code" => "ExpenseVoucher.Partner.Code",//往来单位编码
                    "bill_direction" => "ExpenseVoucher.arapAccountDirection.Name",//记账方向
                    "department_name" => "ExpenseVoucher.Department.Name",//部门
                    "clerk_name" => "ExpenseVoucher.Clerk.Name",//业务员
                    "settle_method" => "ExpenseVoucher.SettleStyle.Name",
                    "account_name" => "ExpenseVoucher.BankAccount.Name",//账号名称
                    "document_makers" => "ExpenseVoucher.Maker",//制单人
                    "document_auditor" => "ExpenseVoucher.Auditor",//审核人
                    "taxAmount" => "ExpenseVoucher.OrigTaxAmountSum",//含税金额
                    "use_pre_payment" => "ExpenseVoucher.OrigPaymentAmount",//使用预付
                    "voucher_status" => "ExpenseVoucher.VoucherState.Name",//单据状态
                ],
                "infoField" => [
                    "voucher_id" => "ExpenseVoucher.ID",
                    "expense_name" => "ExpenseVoucher.Details.ExpenseItem.Name",
                    "expense_code" => "ExpenseVoucher.Details.ExpenseItem.Code",
                    "taxRate|rate" => "ExpenseVoucher.Details.TaxRate",
                    "amount|decimal" => "ExpenseVoucher.Details.OrigAmount",
                    "tax|float:2" => "ExpenseVoucher.Details.OrigTax",
                    "taxAmount|decimal" => "ExpenseVoucher.Details.OrigTaxAmount",//含税金额
                    "accrued_rece_writeoff_amount|decimal" => "ExpenseVoucher.Details.OrigSettleAmount",//累计结款金额
                    "usage_local" => "ExpenseVoucher.Details.ExpenseItemUse",//用途
                    "apport" => "ExpenseVoucher.Details.IsApportion",//已分摊

                    "steel_factory_name" => "ExpenseVoucher.Details.pubuserdefnvc1",//钢厂
                    "material_name" => "ExpenseVoucher.Details.pubuserdefnvc2",//材质
                    "breed_name" => "ExpenseVoucher.Details.pubuserdefnvc3",//品种
                    "car_no" => "ExpenseVoucher.Details.pubuserdefnvc4",//车号
                ]
            ]
        ],
    ];
    /***
     *   消息订阅配置
     *
     */
    public static $msg_subscribe_config = [
        //采购发票 _Create _Delete _Update PurchaseInvoice_Create
        "PurchaseInvoice" => "TplusPurchaseInvoice",
        //销售发票 _Create _Delete _Update
        "SaleInvoice" => "TplusSaleInvoice",
        //其他入库
        "OtherReceiveVoucher" => "TplusOtherInboundOrder",
        //其他出库
        "OtherDispatchVoucher" => "TplusOtherOutboundOrder",
        //入库调整
        "AdjustCostInVoucher" => "TplusInboundAdjustmentOrder",
        //出库调整
        "AdjustCostOutVoucher" => "TplusOutboundAdjustmentOrder",
        //调拨
        "TransVoucher" => "TplusTransferOrder",
        //收款
        "ArapReceive" => "TplusReceiptOrderList",
        //付款
        "ArapPayment" => "TplusPaymentOrderList",
        //盘点单
        "CheckVoucher" =>"TplusCountOrder",
        //采购费用分摊单 没有接口，只有 费用单新增
        //"ExpenseVoucher" => "TplusFeeCostShare",
        //费用单
        "ExpenseVoucher" => "TplusExpenseVoucher",
    ];
    /***
     *   获取业务配置
     *
    */
    public static function getConfig($controller = "TplusCountOrder"){
        return self::$Field[$controller];
    }
    /***
     *   订阅标识获取报表配置
     * @param string SubscribeCode
     *
    */
    public static function getMsgSubscribeConfig($SubscribeCode = ""){
        return self::$msg_subscribe_config[$SubscribeCode];
    }

}

